package com.sikadwafastdaisfondturbo.pretloan.ui.user.activity

import android.view.Gravity
import android.view.View
import com.sikadwafastdaisfondturbo.pretloan.R
import com.sikadwafastdaisfondturbo.pretloan.databinding.ActivityAccountListBinding
import com.sikadwafastdaisfondturbo.pretloan.pro.ProActivity
import com.sikadwafastdaisfondturbo.pretloan.ui.user.page.AccountEnPage
import com.sikadwafastdaisfondturbo.pretloan.ui.user.page.AccountFrenchPage
import com.sikadwafastdaisfondturbo.pretloan.utils.config.Configs
import com.sikadwafastdaisfondturbo.pretloan.utils.event.EventType

/**
 * Sikadwa
 * @Author wwdeng
 * @CreateTime: 2024/4/24 19:56
 * @Annotation：我的账户
 */
class AccountListActivity: ProActivity() {
    lateinit var binding: ActivityAccountListBinding
    override fun getRootView(): View {
        binding = ActivityAccountListBinding.inflate(layoutInflater)
        return binding.root
    }

    override fun initView() {
        setTitleBarVisibility(View.VISIBLE)
        setTextTitle(getString(R.string.personal_receiving_account))
        setTextTitleGravity(Gravity.CENTER)
        setRightBtnRes(R.mipmap.img_kefu_black)
    }

    override fun initListener() {
        //联系客服
        rootViewBinding.ivFun.setOnClickListener {
            showKefuDialog("User Receive Account Page")
            addEvent(EventType.CLICK.CLICK_CUSTOMER,"User Receive Account Page")
        }
    }

    override fun initData() {
        //根据地区显示不同的账户信息
        if(Configs.isFrench()){//法语地区
            replaceContainerFragement(R.id.containerLayout, AccountFrenchPage())
        } else {
            replaceContainerFragement(R.id.containerLayout, AccountEnPage())
        }
    }

    override fun onStart() {
        super.onStart()
        addEvent(EventType.PAGE.PAGE_USER_ACCOUNT_START,"")
    }

    override fun onDestroy() {
        super.onDestroy()
        addEvent(EventType.PAGE.PAGE_USER_ACCOUNT_END,"")
    }
}